
class Document:

    def __init__(self,name):
        self.name = name

    def show(self):
        raise NotImplementedError("Subclass must implement abstract method") # 子类必须自己实现该方法，不得调用此方法，否则报错 面向对象高级 异常


class Pdf(Document):

    def show(self):

        return 'Show pdf contents!'


class Word(Document):

    def show(self):

        return 'Show Word contents!'


pdf_obj = Pdf("嫩模联系方式.pdf")
word_obj = Word("nurse联系方式.doc")

objs = [pdf_obj,word_obj]

for o in objs:
    print(o.show())





